<html>
<head>
<title>Tutorial 3 - The Monthly Returns Report</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td width="100%">
			<table width="100%" height="78" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" id="topnav">
			<tr>
				<!-- Header Side -->
				<td width="17">
					<img height="78" src="media/reportico100.png"/>
				</td>
				<td align="right"></td>
				<td align="center">
					<table width="100%" height="60" border="0" align="left" cellpadding="0" cellspacing="0">
						<tr>
							<td valign="top" align="left">
							<img src="media/repbanner.png"/></td>
							</td>
						</tr>
						<tr>
							<td align="center" valign="bottom" class="topmenucell">
								<nobr>
								&nbsp;
								</nobr>
							</td>
						</tr>
					</table>
				</td>
				<td width="103" class="toplogincell">
					&nbsp;
				</td>
			</tr>
			</table>
</td>
  </tr>
  <!--tr>
    <td class="header_top">reportico</td>
  </tr-->
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_reportico.html" class="menu">class tree: reportico</a> ]
		  [ <a href="../elementindex_reportico.html" class="menu">index: reportico</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_reportico.html">reportico</a><br />
            <br /><br />
		<b>Tutorials/Manuals:</b><br />
					<strong>Package-level:</strong>
							<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.pkg.html">Reportico Tutorial And User Manual</a>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.manual.pkg.html">Reportico User Manual</a>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.quickstart.pkg.html">Reportico Installation</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.gettingstarted.pkg.html">Getting Started</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.structure.pkg.html">Reportico Installation Structure</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.using.pkg.html">Configuring Reportico - System Parameters</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.embedding.pkg.html">Embedding Reportico</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.security.pkg.html">Reportico Security</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.language.pkg.html">Language Support</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.projects.pkg.html">Projects</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.importlink.pkg.html">Importing and linking from reports</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.menus.pkg.html">Report Menus</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.prepare.pkg.html">Report Preparation and Execution</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.design.pkg.html">Report Design Mode</a>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.format.pkg.html">The Design Format Menu</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.customcode.pkg.html">Custom Source Code</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.qrydet.pkg.html">The Query Details Menu</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.assign.pkg.html">The Assignments Menu</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.criteria.pkg.html">The Criteria Menu</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.output.pkg.html">The Output Menu</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.webservices.pkg.html">Turning Reports into Web Services (currently unavailable)</a>
</ul>
</li></ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.faq.pkg.html">Reportico FAQ</a>
</ul>
</li></ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.howto.pkg.html">Reportico Tutorial</a>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1.pkg.html">Tutorial No.1 - The Film Listing Report</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1_1.pkg.html">Tutorial 1 Stage 1 - Creating a basic report</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1_2.pkg.html">Tutorial 1 Stage 2 - Creating User Entry Criteria</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1_3.pkg.html">Tutorial 1 Stage 3 - Working with expressions using assignments</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1_4.pkg.html">Tutorial 1 Stage 4 - Working with groups</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial1_5.pkg.html">Tutorial 1 Stage 5 - Including database graphics into the report and generating drilldowns</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial2_1.pkg.html">Tutorial 2 - Creating the loan history report</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial3_1.pkg.html">Tutorial 3 - The Monthly Returns Report</a>
</ul>
<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.tutorial4_1.pkg.html">Tutorial 4 - The Late Returns Summary report</a>
</ul>
</li></ul>
</li></ul>

							<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.appendix1.pkg.html">Appendix 1 - Reportico Project Configuration parameters</a>
</ul>

							<ul>
	<li type="square"><a href="../reportico/tutorial_reportico.appendix2.pkg.html">Appendix 2 - Reportico URL request parameters</a>
</ul>

									                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../reportico/_reportico.php.html">		reportico.php
		</a><br>
	  </div><br />
      
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" align="left" valign="bottom"><a href=
"../reportico/tutorial_reportico.tutorial2_1.pkg.html">Prev</a></td>
<td width="80%" align="center" valign="bottom"></td>
<td width="10%" align="right" valign="bottom"><a href=
"../reportico/tutorial_reportico.tutorial4_1.pkg.html">Next</a></td>
</tr>
</table>
<span><a name="using."></a><h2 class="title">Tutorial 3 - The Monthly Returns Report</h2>In this tutorial you will
    <p><ol><li><p>Set the report up to group by year</p></li>
	<li><p>Add a graph to the report</p></li></ol></p>
  <a name="tut3_run"></a><h3 class="title">Beginning this tutorial</h3><p>Select <strong>Monthly Returns Report - Begin the Tutorial</strong> from the tutorials menu (Alternatively you can point your browser at the URL <strong>http://{SERVER_ADDRESS}/{REPORTICO_INSTALL_DIRECTORY}/run.php?project=tutorials&amp;execute_mode=PREPARE&amp;xmlin=tut3_1_monthreturns.xml</strong>). You are now ready to start this tutorial.</p>
   <p>On entry to this tutorial, the SQL data query has already been set up. Press the <strong>Execute</strong>
button to see the output. You should see a set of monthly counts ordered by year and month. Press the <strong>Back</strong> button and enter report design mode so that we can add a graph.</p>
   <p>Before configuring this report, it is a good idea to inspect the SQL statement we are using to generate report data. Press the <strong>Query Details</strong> to view the SQL statement. You will notice that the query includes the GROUP BY option to allow us to prudce a count of rentals grouped by month and year. It also makes use of the MySQL <strong>to_days</strong> and <strong>IF</strong> statements in order create a monthly count of films returned more than 2 days after they were borrowed.</p><hr />
   <a name="tut3_1_graph"></a><h3 class="title">Create the graph</h3><p>In this report we want to show monthly film return counts graphed for each year. This means we must first identify that the data is to be grouped on the report by year. To do this click on the <strong>Output</strong> menu tab and then select <strong>Groups</strong>. Click <strong>Add</strong> to add a group. Click the <strong>Group 0</strong> button, and change the <strong>Group On Column</strong> to <strong>loaned yr</strong> and press <strong>Ok</strong> to save the changes.</p>
   <p>Now we want to add the graph. Click on the  <strong>Graphs</strong> subtab and click on  <strong>Add</strong> to add a graph. Select the <strong>Graphs</strong> button and then set the graph configuration as follows :-</p>
   <p><table border = "1"><colgroup span = "1"/><thead><td></td>
  <td>Parameter</td>
  <td>Value</td>
  <td>Comment</td></thead>
<tbody><tr><td>1.</td>
  <td>Group Column</td>
  <td>loaned_yr</td>
  <td></td></tr>
<tr><td>2.</td>
  <td>Title</td>
  <td>Rentals {loaned_yr}</td>
  <td>The title to give the report</td></tr>
<tr><td>3.</td>
  <td>Column for X Labels</td>
  <td>loaned_mth</td>
  <td>Indicates that the month will be used to label the X Axis</td></tr></tbody></table>
Press the <strong>Ok</strong> button to continue.</p><hr />
   <a name="tut3_1_plots"></a><h3 class="title">Enter the Graph Plot Values</h3><p>The last graph configuration you need to do is to indicate which report values are to be plotted. Click on the <strong>Plots</strong> subtab, press the <strong>Add</strong> button and press the resulting <strong>Plots</strong> link. You should be presented with a set of plot parameters.</p>
   <p>Change these as follows :-
<table border = "1"><colgroup span = "1"/><thead><td></td>
  <td>Parameter</td>
  <td>Value</td>
  <td>Comment</td></thead>
<tbody><tr><td>1.</td>
  <td>Column To Plot</td>
  <td>loan_count</td>
  <td>The monthly rental count will be plotted above each month.</td></tr>
<tr><td>2.</td>
  <td>Plot Style</td>
  <td>BAR</td>
  <td>The value will be plotted as bar chart</td></tr>
<tr><td>3.</td>
  <td>Fill Color</td>
  <td>yellow</td>
  <td>iThe color of each bar plotted</td></tr></tbody></table></p><hr />
   <a name="tut3_1_plots2"></a><h3 class="title">Enter a Second Graph Plot Value</h3><p>We want to plot both monthly count and monthly late return count so we need to add this as a second plot.
Click on the <strong>Plots</strong> subtab, and again press the <strong>Add</strong> button and press the resulting <strong>Plots 1</strong> link. This time select the following plot paramter values :-</p>
   <p><table border = "1"><colgroup span = "1"/><thead><td></td>
  <td>Parameter</td>
  <td>Value</td>
  <td>Comment</td></thead>
<tbody><tr><td>1.</td>
  <td>Column To Plot</td>
  <td>overdue</td>
  <td>The monthly late return count will be plotted above each month</td></tr>
<tr><td>2.</td>
  <td>Plot Style</td>
  <td>BAR</td>
  <td>The value will be plotted as bar chart</td></tr>
<tr><td>3.</td>
  <td>Fill Color</td>
  <td>orange</td>
  <td>To contrast with the yellow of the monthly count</td></tr></tbody></table></p><hr />
   <a name="tut3_check"></a><h3 class="title">Check the Report</h3><p>Return to report execution mode and run the report.
You should see a count of film rentals per month and a graph for each year representing this data.</p><hr /></span>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="../reportico/tutorial_reportico.tutorial2_1.pkg.html">Prev</a></td>
<td width="34%" align="center" valign="top"><a href=
"../reportico/tutorial_reportico.howto.pkg.html">Up</a></td>
<td width="33%" align="right" valign="top"><a href=
"../reportico/tutorial_reportico.tutorial4_1.pkg.html">Next</a></td>
</tr>

<tr>
<td width="33%" align="left" valign="top">Tutorial 2 - Creating the loan history report</td>
<td width="34%" align="center" valign="top">Reportico Tutorial</td>
<td width="33%" align="right" valign="top">Tutorial 4 - The Late Returns Summary report</td>
</tr>
</table>
        <div class="credit">
		    <hr />
		    Documentation generated on Mon, 09 Jun 2014 18:10:08 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>